﻿// -----------------------------------------------------------------------
// <copyright file="AudioCommon.cs" company="Abyssalsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Core.Player.Audio
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    internal class AudioCommon
    {
        /// <summary> Lock synchronization object. </summary>
        private static readonly object Padlock = new object();

        /// <summary> Used to reference current instance </summary>
        private static AudioCommon instance = null;

        /// <summary> Stores our handler </summary>
        private int intCurrentStream;

        /// <summary> Prevents a default instance of the AudioCommon class from being created. </summary>
        private AudioCommon()
        {
        }

        /// <summary> Gets the current instance of this class (Singleton - Thread safety)... With double check! </summary>
        internal static AudioCommon Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (Padlock)
                    {
                        if (instance == null)
                        {
                            instance = new AudioCommon();
                        }
                    }
                }

                return instance;
            }
        }

        /// <summary> Gets or sets current stream (this is something like a pointer) </summary>
        internal int Stream
        {
            get { return this.intCurrentStream; }
            set { this.intCurrentStream = value; }
        }
    }
}
